<!DOCTYPE html>
<html lang="en">

<head>
    <title></title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1 user-scalable=no">
</head>

<body>

    <script>
        // 方法一
        var url = "http://www.taobao.com/index.php?key0=0&key1=1&key2=2.............";
        var obj = parseQueryString(url);
        console.log(obj); // {key0: "0", key1: "1", key2: "2............."}

        function parseQueryString(argu) {
            var str = argu.split('?')[1];
            var result = {};
            var temp = str.split('&');
            for (var i = 0; i < temp.length; i++) {

                var temp2 = temp[i].split('=');

                result[temp2[0]] = temp2[1];

            }
            return result;
        }

        //方法二
        var param = new URLSearchParams(字符串).get('获取的值');

        //方法三
        function getParamsByUrl(url, name) {

            var params = url.substr(url.indexOf("?") + 1);
 
            var param = params.split('&');

            for (var i = 0; i < param.length; i++) {

                var current = param.spli('=');

                if (current[0] == name) {

                    return current[1];
                }
            }
            return null;
        }
    </script>
</body>

</html>